<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>权限信息表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link th:href="@{../assets/css/page.css}" rel="stylesheet"/>
    <link th:href="@{../assets/libs/nice-validator/dist/jquery.validator.css}" rel="stylesheet"/>
    <script type="text/javascript" th:src="@{../assets/libs/jquery/dist/jquery.js}"></script>
    <script type="text/javascript" th:src="@{../assets/libs/nice-validator/dist/jquery.validator.js}"></script>
    <script type="text/javascript" th:src="@{../assets/libs/nice-validator/dist/local/zh-CN.js}"></script>
    <script type="text/javascript" th:src="@{../assets/js/login/jquery.tips.js}"></script>
    <script type="text/javascript" th:src="@{../assets/js/page.js}"></script>
    <!--[if lt IE 9]>
    <script th:src="@{../assets/js/html5shiv.js}"></script>
    <script th:src="@{../assets/js/respond.min.js}"></script>
    <![endif]-->
    <script type="text/javascript" th:inline="javascript">
        $(function () {
            $.ajax({
                url:'../system_manger/pageQuery?ckey=icon ',
                type:"get",
                dataType:"json",
                success:function (result) {

                    var html="";
                    var cicon = [[${item.cicon}]];

                    $.each(result.rows,function (i,item) {
                        var bool = cicon == item.ctypename;
                        if(bool){
                            html += "<option value="+item.ctypename+" selected="+bool+">"+item.ctypename+"</option>";
                        }else{
                            html += "<option value="+item.ctypename+">"+item.ctypename+"</option>";
                        }
                    })
                    $("#cicon").html(html);
                },
                error:function (error) {

                }
            })

            $("#cicon").change(function () {
                var cicon = $("#cicon option:selected").text();
                $("#yulan").attr("class",cicon);
                $("#ciconsub").val(cicon);
            })
        })
    </script>
</head>
<body class="inside-header inside-aside is-dialog">
<div id="main" role="main">
    <div class="tab-content tab-addtabs">
        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div class="content">
                        <form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="./editItem">
                            <input id="iid" name="iid" th:value="${item.iid}" type="hidden"/>
                            <!--<div class="form-group">
                                <label for="ipid" class="control-label col-xs-12 col-sm-2">外键:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="ipid" name="ipid" value="" data-rule="required"/>
                                </div>
                            </div>-->
                            <div class="form-group">
                                <label for="icode" class="control-label col-xs-12 col-sm-2">权限值:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="icode" name="icode" th:value="${item.icode}" data-rule="required"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cname" class="control-label col-xs-12 col-sm-2">权限名称:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="cname" name="cname" th:value="${item.cname}" data-rule="required"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="curl" class="control-label col-xs-12 col-sm-2">权限操作链接:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="curl" name="curl" th:value="${item.curl}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="isort" class="control-label col-xs-12 col-sm-2">显示顺序:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="isort" name="isort" th:value="${item.isort}" data-rule="required"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="isshow" class="control-label col-xs-12 col-sm-2">是否显示:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <select name="isshow" id="isshow" class="form-control">
                                        <option value="1" th:selected="${item.isshow==1}">显示</option>
                                        <option value="0" th:selected="${item.isshow==0}">不显示</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cicon" class="control-label col-xs-12 col-sm-2">图标名称:</label><i th:class="${item.cicon}" id="yulan" style="margin-top: 8px;"> 预览</i>
                                <div class="col-xs-12 col-sm-8">
                                    <select class="form-control" id="cicon">
                                    </select>
                                    <input type="hidden" id="ciconsub" th:value="${item.cicon}" name="cicon"/>
                                    <!--<input type="text" class="form-control" id="cicon" name="cicon" th:value="${item.cicon}" data-rule="required"/>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="ccomment" class="control-label col-xs-12 col-sm-2">备注:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="ccomment" name="ccomment" th:value="${item.ccomment}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2"></label>
                                <div class="col-xs-12 col-sm-8 text-center">
                                    <button type="submit" class="btn btn-success btn-embossed">确定</button>
                                    <button type="reset" class="btn btn-default btn-embossed">重置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap/dist/js/bootstrap.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/toastr/toastr.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/layer/src/layer.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js}"></script>
</body>
</html>

